pkg_check_modules(vorbis IMPORTED_TARGET vorbis)
pkg_check_modules(vorbisfile IMPORTED_TARGET vorbisfile)
if(TARGET PkgConfig::vorbis AND TARGET PkgConfig::vorbisfile)
    add_library(mltvorbis MODULE factory.c producer_vorbis.c)
    target_link_libraries(mltvorbis mlt PkgConfig::vorbis PkgConfig::vorbisfile)
    set_target_properties(mltvorbis PROPERTIES LIBRARY_OUTPUT_DIRECTORY ..)
    install(TARGETS mltvorbis LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mlt)
    file(GLOB yml *.yml)
    install(FILES ${yml} DESTINATION ${CMAKE_INSTALL_DATADIR}/mlt/vorbis)
endif()
